package com.yjs.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yjs.bean.History;
import com.yjs.mapper.HistoryMapper;
import com.yjs.service.HistoryService;

import java.util.List;

/**
 * @author yjs
 * @create 2020-09-22-16:55
 * 历史实现类
 */
@Service
public class HistoryServiceImpl implements HistoryService {
    //注入历史mapper
    @Autowired
    HistoryMapper historyMapper;
    //查询所有历史
    @Override
    public List<History> getAllHistory() {
        List<History> allHistory = historyMapper.getAllHistory();
        if (allHistory.size()>0 && allHistory!=null){
            return allHistory;
        }
        return null;
    }
    //新增历史
    @Override
    public void addHistory(History history) {
        historyMapper.addHistory(history);
    }
}
